package com.luochen.cdpt.eneity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.util.Date;
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEneity {

	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @CreatedDate
	@Column(
			name = "tcrttm",
			updatable = false
	)
	private Date tcrttm;//创建时间

	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@LastModifiedDate
	@Column(
			name = "tupdtm",
			updatable = true
	)
	private Date tupdtm;//修改时间

	@CreatedBy
	@Column(
			name = "ccrtcde",
			updatable = false
	)
	private String ccrtcde;//创建人

	@LastModifiedBy
	private String cupdcde;//修改人
	
}
